/*
 * Copyright 2012 Biz-e (info@biz-e.nl)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package nl.biz_e.android.calllog;

import android.util.Log;

/**
 * Base exception for this application.<br/>
 * Nothing special yet. Just leaves room to implement some base logic.
 * 
 * @author Joost A. Bloemsma
 */
public class CallLogException extends Exception {
	private static final long serialVersionUID = 2994792169030870696L;

	/**
	 * Constructs a new CallLogException instance
	 */
	public CallLogException() {
		super();
	}

	/**
	 * Constructs a new CallLogException instance
	 * @param detailMessage
	 */
	public CallLogException(String detailMessage) {
		super(detailMessage);
		_logDebug(detailMessage);
	}

	/**
	 * Constructs a new CallLogException instance
	 * @param throwable
	 */
	public CallLogException(Throwable throwable) {
		super(throwable);
	}

	/**
	 * Constructs a new CallLogException instance
	 * @param detailMessage
	 * @param throwable
	 */
	public CallLogException(String detailMessage, Throwable throwable) {
		super(detailMessage, throwable);
		_logDebug(detailMessage);
	}
	
	private void _logDebug(String msg) {
		String tag = this.getClass().getSimpleName();
		if (Log.isLoggable(tag, Log.DEBUG)) Log.d(tag, msg);
	}

}

